package string;
/**
* boolean startsWith(String s)
* 判断当前字符串是否是以给定的字符串(s)开始的
* boolean endsWith(String s)
* 判断当前字符串是否是以给定的字符串(s)结束的
* */
public class StartsWithDemo {
    public static void main(String[] args) {
        String str = "thinking in java";
        boolean start = str.startsWith("think");//判断是否以think开头
        System.out.println(start);//true
        boolean ends = str.endsWith(".png");//判断是否以.png结尾
        System.out.println(ends);//false
    }

}
